import { Component, OnInit } from '@angular/core';
import { MessageService } from 'src/app/core/service';
import { ApiService, urlService } from 'src/app/core/api';
import { environment } from 'src/environments/environment';

@Component({
  selector: 'app-recharge-rule',
  templateUrl: './recharge-rule.component.html',
  styleUrls: ['./recharge-rule.component.scss']
})
export class RechargeRuleComponent implements OnInit {
  url = urlService(environment.type, '用户充值规则');
  data: any = {};
  constructor(private obs: MessageService, private api: ApiService) {
  }
  ngOnInit() {
    this.obs.sendMessage('用户充值规则');
    this.api.post(this.url, {}).subscribe((res: any) => {
      this.data = res.data;
      this.data.instruction = this.data.instruction.replace(/\n/g, '<br>');
    });
  }
}

